package com.rjwh.dingdong.client.mvp.model.impl;

import com.aishua.lib.task.AsResult;
import com.rjwh.dingdong.client.application.MyApplication;
import com.rjwh.dingdong.client.constant.LocalConstant;
import com.rjwh.dingdong.client.constant.NetConstant;
import com.rjwh.dingdong.client.mvp.BaseModel;
import com.rjwh.dingdong.client.mvp.BasePresenter;
import com.rjwh.dingdong.client.mvp.model.IDrawBookCatalogMainActivityModel;
import com.rjwh.dingdong.client.network.HttpWebService;
import com.rjwh.dingdong.client.network.HttpWebServiceCallBack;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Kay on 2016-6-3.
 */
public class DrawBookCatalogMainActivityModel extends BaseModel implements IDrawBookCatalogMainActivityModel, HttpWebServiceCallBack {


    public DrawBookCatalogMainActivityModel(BasePresenter basePresenter) {
        super(basePresenter);
    }

    /**
     * 获取年龄段
     */
    @Override
    public void doGetAge() {
        Map<String, String> params = new HashMap<String, String>();
        params.put("userid", MyApplication.spUtil.getStrPreferenceByParamName(MyApplication.app, LocalConstant.SP_USERID));
        HttpWebService.getDataFromServer(NetConstant.GETAGE, params, true, this);
    }

    @Override
    public void onServerDataAcquired(int businessType, AsResult mAsResult, boolean isRefresh) {
        if (getBasePresenter() != null)
            getBasePresenter().onServerDataAcquired(businessType, mAsResult, isRefresh);
    }
}
